<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="HospitalEditDlg" widgetVar="HospitalEditDialog" modal="true" resizable="false" appendToBody="true" header="#{myBundle.EditHospitalTitle}">

            <h:form id="HospitalEditForm">

                <h:panelGroup id="display">
                    <p:panelGrid  columns="2" rendered="#{hospitalController.selected != null}">

                        <h:outputLabel value="#{myBundle.EditHospitalLabel_hid}" for="hid" />
                        <h:outputText id="hid" value="#{hospitalController.selected.hid}" />

                        <p:outputLabel value="#{myBundle.EditHospitalLabel_name}" for="name" />
                        <p:inputText id="name" value="#{hospitalController.selected.name}" title="#{myBundle.EditHospitalTitle_name}" required="true" requiredMessage="#{myBundle.EditHospitalRequiredMessage_name}"/>

                        <p:outputLabel value="#{myBundle.EditHospitalLabel_description}" for="description" />
                        <p:inputText id="description" value="#{hospitalController.selected.description}" title="#{myBundle.EditHospitalTitle_description}" required="true" requiredMessage="#{myBundle.EditHospitalRequiredMessage_description}"/>

                        <p:outputLabel value="#{myBundle.EditHospitalLabel_building}" for="building" />
                        <p:inputText id="building" value="#{hospitalController.selected.building}" title="#{myBundle.EditHospitalTitle_building}" required="true" requiredMessage="#{myBundle.EditHospitalRequiredMessage_building}"/>

                        <p:outputLabel value="#{myBundle.EditHospitalLabel_street}" for="street" />
                        <p:inputText id="street" value="#{hospitalController.selected.street}" title="#{myBundle.EditHospitalTitle_street}" required="true" requiredMessage="#{myBundle.EditHospitalRequiredMessage_street}"/>

                        <p:outputLabel value="#{myBundle.EditHospitalLabel_town}" for="town" />
                        <p:inputText id="town" value="#{hospitalController.selected.town}" title="#{myBundle.EditHospitalTitle_town}" required="true" requiredMessage="#{myBundle.EditHospitalRequiredMessage_town}"/>

                        <p:outputLabel value="#{myBundle.EditHospitalLabel_city}" for="city" />
                        <p:inputText id="city" value="#{hospitalController.selected.city}" title="#{myBundle.EditHospitalTitle_city}" required="true" requiredMessage="#{myBundle.EditHospitalRequiredMessage_city}"/>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{hospitalController.save}" value="#{myBundle.Save}" update="display,:HospitalListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,HospitalEditDialog);"/>
                    <p:commandButton value="#{myBundle.Cancel}" onclick="HospitalEditDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
